CXX=g++
SRC=src
OBJ=obj
EXE=bin
INC=include
CPPFLAGS=-c -g -O0 -Wall -I$(INC)

OBJFILES=$(OBJ)/linkListUtilities.o \
		 $(OBJ)/removeDuplicate.o \
		 $(OBJ)/findNthLast.o \
		 $(OBJ)/addLinkList.o \
         $(OBJ)/removeNthFromEnd.o

all: testLinkList.exe \
	 testFindNthLastNode.exe \
	 testAddLinkList.exe \
	 testFindJointNode.exe \
     testRemoveNthNode.exe \
	 install

testLinkList.exe : $(OBJ)/testLinkList.o $(OBJFILES)
	$(CXX) -o $@ $^

testFindNthLastNode.exe : $(OBJ)/testFindNthLastNode.o $(OBJFILES)
	$(CXX) -o $@ $^

testAddLinkList.exe : $(OBJ)/testAddLinkList.o $(OBJFILES)
	$(CXX) -o $@ $^

testFindJointNode.exe : $(OBJ)/testFindJointNode.o $(OBJFILES)
	$(CXX) -o $@ $^

testRemoveNthNode.exe : $(OBJ)/testRemoveNthNode.o $(OBJFILES)
	$(CXX) -o $@ $^

$(OBJ)/%.o : $(SRC)/%.cpp
	$(CXX) $(CPPFLAGS) -o $@ $<

install:
	mv *.exe $(EXE)

clean:
	rm -rf $(OBJ)/*.o $(EXE)/*.exe
